﻿#ifndef UDP_CLASS_H
#define UDP_CLASS_H

#include <QUdpSocket>
#include <QHostAddress>
#include <QNetworkDatagram>

class UDP_Service:public QObject
{
    Q_OBJECT
public:
    UDP_Service();
    ~UDP_Service();

public slots:
    void OpenUdp(const QString ipAddress, const quint16 port);
    void CloseUdp();
    void SendUdpMsg(QByteArray msg,QString obj_ip,quint16 obj_port);
    void ReadUdpMessage();
signals:
    void BindSuccess();
    void UdpModeMsg(QByteArray message);
private:
    QUdpSocket *UdpServer;
};

#endif // UDP_CLASS_H
